﻿using System;
using System.Windows.Controls;
using System.Windows.Threading;

namespace TheOliver.Controls.DigitalDisplay
{
    public partial class DigitalClock : UserControl
    {
        public DigitalClock()
        {
            InitializeComponent();

            DispatcherTimer timer = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            timer.Tick += (s, e) =>
                {
                    _hours.DiplayValue = DateTime.Now.Hour;
                    _minutes.DiplayValue = DateTime.Now.Minute;
                    _seconds.DiplayValue = DateTime.Now.Second;
                };
            timer.Start();
        }
    }
}
